package pers.cz.service.impl;

import pers.cz.business.TaskJobHisBusiness;
import pers.cz.model.SystemJobLog;
import pers.cz.model.TaskJobReport;
import pers.cz.pub.BeanHelper;
import pers.cz.service.TaskJobHisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @program: PostGirl-panent
 * @description: TaskJobHisServiceImpl
 * @author: Cheng Zhi
 * @create: 2021-10-31 14:33
 **/
@Service
public class TaskJobHisServiceImpl implements TaskJobHisService {

    @Autowired
    BeanHelper beanHelper;

    @Override
    public List<SystemJobLog> queryAllJobLogByPage(Integer jobId, Integer pageStart, Integer pageLimit) {

        TaskJobHisBusiness business = new TaskJobHisBusiness();
        business.setMapper(beanHelper);
        return business.queryAllJobLogByPage(jobId, pageStart, pageLimit);
    }

    @Override
    public List<SystemJobLog> queryAllJobLogByCondition(Date startTime, Date endTime) {
        return null;
    }

    @Override
    public Integer queryJobLogCountNum(Integer jobId) {
        TaskJobHisBusiness business = new TaskJobHisBusiness();
        business.setMapper(beanHelper);
        Integer count = business.queryJobLogCountNum(jobId);
        return count;
    }

    @Override
    public TaskJobReport queryReporyNameBySonbr(Long soNbr) {
        TaskJobHisBusiness business = new TaskJobHisBusiness();
        business.setMapper(beanHelper);
        return business.queryReporyNameBySonbr(soNbr);
    }

    @Override
    public Integer deleteJobLog(Integer id) {
        TaskJobHisBusiness business = new TaskJobHisBusiness();
        business.setMapper(beanHelper);
        return business.deleteJobLog(id);
    }

}
